package com.itheima.controller;

import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/pages/")
public class RestfulController {

    @RequestMapping(value = "{id}", method = RequestMethod.GET)
    public String test1(@PathVariable Integer id) {

        System.out.println("get running..." + id);

        return "";
    }

    //@RequestMapping(value = "{id}", method = RequestMethod.POST)
    @PostMapping("{id}")//等于上面的一行
    public String test2(@PathVariable Integer id) {
        System.out.println("post running..." + id);
        System.out.println(id);

        return "";
    }

    @RequestMapping(value = "{id}", method = RequestMethod.DELETE)
    public String test3(@PathVariable Integer id) {
        System.out.println("delete running..." + id);
        System.out.println(id);

        return "";
    }

    @RequestMapping(value = "{id}", method = RequestMethod.PUT)
    public String test4(@PathVariable Integer id) {
        System.out.println("put running..." + id);
        System.out.println(id);

        return "";
    }

}
